<?php
    class loaisanphamc1bs
    {
        public $MaLoaiSanPhamCap1 = 0;
		public $TenLoaiSanPhamCap1 = '';
        public $MaLoaiSanPham = 0;
        
        public $MaLoaiSanPhamCap2 = 0;
        public $MaLoaiSanPhamCap3 = 0;
        
        //Phân trang
        public $SoLoaiSanPham = 6;
        public $P = 1;
		
		public function getList($order = '', $start = 0, $num = 30, $all = 1)
		{
			$db = new loaisanphamc1db();
			return $db->getList($this->MaLoaiSanPhamCap1, $this->TenLoaiSanPhamCap1, $this->MaLoaiSanPham, $order, $start, $num, $all);
		}
        
        public function getIds()
		{
			$db = new loaisanphamc1db();
			return $db->getIds($this->MaLoaiSanPham, $this->MaLoaiSanPhamCap2, $this->MaLoaiSanPhamCap3);
		}
		
		public function add()
		{
			$db = new loaisanphamc1db();
			return $db->add($this->TenLoaiSanPhamCap1, $this->MaLoaiSanPham);
		}
		
		public function update()
		{
			$db = new loaisanphamc1db();
			return $db->update($this->MaLoaiSanPhamCap1, $this->TenLoaiSanPhamCap1, $this->MaLoaiSanPham);
		}
		
		public function delete()
		{
			$db = new loaisanphamc1db();
			return $db->delete($this->MaLoaiSanPhamCap1);
		}
        
        public function issetTypes()
		{
			$db = new loaisanphamc1db();
			return $db->issetTypes($this->MaLoaiSanPhamCap1 ,$this->TenLoaiSanPhamCap1, $this->MaLoaiSanPham);
		}
        
        public function issetType()
		{
			$db = new loaisanphamc1db();
			return $db->issetType($this->TenLoaiSanPhamCap1, $this->MaLoaiSanPham);
		}
		
		public function totalPage()
        {
            $db = new loaisanphamc1db();
			return $db->totalPage($this->SoLoaiSanPham);
        }
        
        public function paging()
        {
            $db = new loaisanphamc1db();
			return $db->paging($this->SoLoaiSanPham, $this->P);
        }
    }
?>